package Day2025_03_27;

public class LeetCode24 {
    public ListNode swapPairs(ListNode head) {
        if (head == null || head.next == null) return head;
        ListNode ret = swapPairs(head.next.next);
        ListNode newHead = head.next;
        newHead.next = head;
        head.next = ret;
        return newHead;
    }
}

